jQuery(document).ready(function(){if(window.scrollY!=0){jQuery("header").css("background","var(--darkblue)");jQuery("header .custom-logo-link img").css("max-width","100px")}else{jQuery("header").css("background","linear-gradient(0deg, rgba(236,236,240,0) 0%, rgba(3,17,54,1) 100%, rgba(3,17,54,1) 100%)");jQuery("header .custom-logo-link img").css("max-width","195px")} var attraction=jQuery(".prefooter").data("attraction");if(attraction){attraction=attraction.replace(" ","");attraction=attraction.toLowerCase()} function isMobile(){return window.innerWidth<=768} function handleHover(){jQuery(".currency-dropdown").hover(function(){jQuery(".dropdown-options").show()},function(){jQuery(".dropdown-options").hide()})} function handleClick(){jQuery(".currency-dropdown .ast-menu-toggle").click(function(){jQuery(".dropdown-options").slideToggle()})} if(!isMobile()){handleHover()}else{handleClick()} jQuery(window).resize(function(){if(!isMobile()){jQuery(".currency-dropdown").off('mouseenter mouseleave');handleHover()}else{jQuery(".currency-dropdown .ast-menu-toggle").off('click');handleClick()}});jQuery(".dropdown-option").click(function(){let currency=jQuery(this).find("input").val();jQuery("#currency-list .selected-option").html(currency);updateCurrencies(currency)});setDynamicDAT();jQuery('a[href]').on('click',function(){const url=new URL(this.href,location.origin);const params=url.searchParams;const paramMap={cmp:"gyg",campaign:"viator",tq_campaign:"tiq"};let dataset=null;for(const[paramName,providerCode]of Object.entries(paramMap)){const paramValue=params.get(paramName);if(paramValue){dataset={campaign:paramValue,provider:providerCode};break}} if(dataset){jQuery.ajax({url:'https://mint.energit.biz/api/campaign-click',method:'POST',data:JSON.stringify(dataset),contentType:'application/json',processData:!1,crossDomain:!0,xhrFields:{withCredentials:!1}})}})});function updateCurrencies(currency){document.cookie="currency_cookie="+currency+"; path=/; max-age="+60*60*24*30;jQuery(".dynamic-price").each(function(){let originalPrice=jQuery(this).attr("data-price");let hadDecimalPlaces=originalPrice.indexOf(".")>-1;let newPrice=parseFloat(originalPrice)*window.CURRENCIES[currency].value;if(hadDecimalPlaces){newPrice=newPrice.toLocaleString('de-DE',{minimumFractionDigits:2,maximumFractionDigits:2})}else{newPrice=Math.floor(newPrice)} jQuery(this).html(window.CURRENCY_SYMBOLS[currency]+' '+newPrice)})} function setDynamicDAT(){const now=new Date();const cetDate=new Date(now.toLocaleString("en-US",{timeZone:"Europe/Berlin"}));const pad=n=>String(n).padStart(2,'0');const ts=cetDate.getFullYear()+pad(cetDate.getMonth()+1)+pad(cetDate.getDate())+pad(cetDate.getHours())+pad(cetDate.getMinutes())+pad(cetDate.getSeconds());jQuery('a[href*="DAT"]').each(function(){this.href=this.href.replace(/DAT\d{14}/g,'DAT'+ts)})} jQuery(document).scroll(function(){if(jQuery(document).scrollTop()!=0){jQuery("header").css("background","var(--darkblue)");jQuery("header .custom-logo-link img").css("max-width","100px")}else{jQuery("header").css("background","linear-gradient(0deg, rgba(236,236,240,0) 0%, rgba(3,17,54,1) 100%, rgba(3,17,54,1) 100%)");jQuery("header .custom-logo-link img").css("max-width","195px")}});jQuery(window).scroll(function(){if(document.getElementById("booking")){var hT=jQuery('#booking').offset().top,hH=jQuery('#booking').outerHeight(),wH=jQuery(window).height(),wS=jQuery(this).scrollTop();if(wS>(hT+hH-wH)){jQuery('#rg-book').hide()}else{jQuery('#rg-book').show()}}})